<%-- 
    Document   : rapored
    Created on : Dec 6, 2009, 11:51:36 PM
    Author     : Milan Boricic <boricic@gmail.com>
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="t" uri="http://myfaces.apache.org/tomahawk" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        </head>
        <body>
            <h:form>
            <h2><h:outputText value="#{korisnik.izabrana.naziv}" /></h2>
            <br/>
            <br/>
            <table>
                <tr>
                    <c:forEach items="#{korisnik.dani}" var="danItem">
                        <td valign="top" nowrap="nowrap">
                            <h:outputText value="#{danItem.naziv}"/>&ndash;
                        <b><h:outputText value="#{danItem.datumString}"/></b>
                        <h:dataTable value="#{danItem.termini}"
                                     var="terminItem"
                                     rendered="#{(danItem.neradan == null)}"
                                     styleClass="stats"
                                     >
                            <h:column >
                                <h:outputText styleClass="vreme" value="#{terminItem.vremeString}"/>
                            </h:column>

                            <h:column>
                                <h:outputText value="#{terminItem.rezervacija.namena}"
                                              rendered="#{terminItem.zauzet}"
                                              styleClass="zauzet"/>
                                <h:outputText value="<br/>" escape="false" rendered="#{terminItem.zauzet}" />
                                <h:outputText value="#{terminItem.rezervacija.korisnik.ime}"
                                              rendered="#{terminItem.zauzet}"
                                              styleClass="zauzet"/>
                                <h:outputText value=" " escape="false" rendered="#{terminItem.zauzet}" />
                                <h:outputText value="#{terminItem.rezervacija.korisnik.prezime}"
                                              rendered="#{terminItem.zauzet}"
                                              styleClass="zauzet"/>
                                <h:commandButton value="Rezervisi"
                                               rendered="#{!(terminItem.zauzet)}"
                                               action="#{terminItem.rezervisi}">
                                    <%--<f:setPropertyActionListener target="#{korisnik.termin}" value="#{terminItem}" />--%>
                                </h:commandButton>
                            </h:column>
                        </h:dataTable>
                        <h:outputText value="<br/>" escape="false" rendered="#{(danItem.neradan != null)}" />
                        <b><h:outputText value="Neradan dan" escape="false" rendered="#{(danItem.neradan != null)}" /></b>
                        <h:outputText value="<br/>" escape="false" rendered="#{(danItem.neradan != null)}" />
                        <h:outputText value="#{danItem.neradan.razlog}"
                                  rendered="#{(danItem.neradan != null)}" />
                                
                        </td>
                    </c:forEach>
                    </h:form>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td valign="top">
                        <h:form id="calendarForm">
                        <t:inputCalendar monthYearRowClass="yearMonthHeader"
                                         weekRowClass="weekHeader"
                                         currentDayCellClass="currentDayCell"
                                         binding="#{korisnik.cal}"
                                         valueChangeListener="#{korisnik.calChange}"
                                         style="background-color:#CDD7D2;"/>

                        </h:form>
                    </td>
                    </tr>
               </table>
        </body>
    </html>
